package com.party.core.model.member;

import com.party.core.model.commune.CMoment;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @program: party
 * @description: 移动端-动态实体输出
 * @author: Hua Qunhao
 * @create: 2019-12-23 16:17
 **/
public class CMomentOutput {
    //数据id
    private String id;
    //动态类型
    private Integer momentType;
    //数据类型
    private Integer dataType;
    //是否置顶
    private Integer isTop;
    //发布者头像url
    private String avatarUrl;
    //发布者
    private String avatar;
    //发布机构
    private String announcerOrg;
    //内容
    private String content;
    //海报
    private List<String> picList;
    //多媒体链接
    private String multimediaUrl;
    //跳转目标id
    private String targetId;
    //数据列表
    private List<Map<String,Object>> datas;
    //发布时间
    private Date createDate;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getMomentType() {
        return momentType;
    }

    public void setMomentType(Integer momentType) {
        this.momentType = momentType;
    }

    public Integer getDataType() {
        return dataType;
    }

    public void setDataType(Integer dataType) {
        this.dataType = dataType;
    }

    public Integer getIsTop() {
        return isTop;
    }

    public void setIsTop(Integer isTop) {
        this.isTop = isTop;
    }

    public String getAvatarUrl() {
        return avatarUrl;
    }

    public void setAvatarUrl(String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    public String getAnnouncerOrg() {
        return announcerOrg;
    }

    public void setAnnouncerOrg(String announcerOrg) {
        this.announcerOrg = announcerOrg;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public List<String> getPicList() {
        return picList;
    }

    public void setPicList(List<String> picList) {
        this.picList = picList;
    }

    public String getMultimediaUrl() {
        return multimediaUrl;
    }

    public void setMultimediaUrl(String multimediaUrl) {
        this.multimediaUrl = multimediaUrl;
    }

    public String getTargetId() {
        return targetId;
    }

    public void setTargetId(String targetId) {
        this.targetId = targetId;
    }

    public List<Map<String, Object>> getDatas() {
        return datas;
    }

    public void setDatas(List<Map<String, Object>> datas) {
        this.datas = datas;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    @Override
    public String toString() {
        return "CMomentOutput{" +
                "id='" + id + '\'' +
                ", momentType=" + momentType +
                ", dataType=" + dataType +
                ", isTop=" + isTop +
                ", avatarUrl='" + avatarUrl + '\'' +
                ", avatar='" + avatar + '\'' +
                ", announcerOrg='" + announcerOrg + '\'' +
                ", content='" + content + '\'' +
                ", picList=" + picList +
                ", multimediaUrl='" + multimediaUrl + '\'' +
                ", targetId='" + targetId + '\'' +
                ", datas=" + datas +
                ", createDate=" + createDate +
                '}';
    }

    public static CMomentOutput transform(CMoment input) {
        CMomentOutput output = new CMomentOutput();
        try {
            BeanUtils.copyProperties(output, input);
        } catch (IllegalAccessException | InvocationTargetException e) {
            e.printStackTrace();
        }
        return output;
    }
}
